import { createStore } from 'vuex';

import {
  GET_TEST,
  SET_TEST
} from './actionTypes';

export default createStore({
  state: {
    test: '这是一条测试数据, 可在输入框内按回车修改'
  },
  mutations: {
    [SET_TEST](state, data) {
      state.test = data;
    }
  },
  actions: {
    [SET_TEST]({ commit }, data) {
      commit(SET_TEST, data);
    }
  },
  getters: {
    [GET_TEST]: state => state.test
  },
  modules: {}
})